import {
	mapMutations
} from 'vuex'
export default {
	...mapMutations([
		'upUserInfo'
	]),
	getData() {
		let that = this
		that.$httpRequest.get({
			that: that,
			url: 'wechat/getNewFollow',
			params: {},
			success: res => {
				that.loading = false
				if (res.code === that.$httpConfig.SUCCESS_CODE) {
					that.list = res.data
				}
			}
		})
	},
	toFollowFans(id, index) {
		let that = this
		that.$httpRequest.request({
			that: that,
			url: 'wechat/followFans',
			params: {
				followUserId: id
			},
			success: res => {
				that.loading = false
				if (res.code === that.$httpConfig.SUCCESS_CODE) {
					that.getData()
				}
			}
		})
	},
	unfollow(id, index) {
		let that = this
		that.$httpRequest.request({
			that: that,
			url: 'wechat/unfollow',
			params: {
				followUserId: id
			},
			success: res => {
				that.loading = false
				if (res.code === that.$httpConfig.SUCCESS_CODE) {
					that.getData()
				}
			}
		})
	}
}